package com.woniu.service.impl;

import com.woniu.adapter.RegionAdapter;
import com.woniu.outlet.po.RegionPo;
import com.woniu.service.RegionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class RegionServiceImpl implements RegionService {

    @Autowired
    private RegionAdapter regionAdapter;

    @Override
    public List<RegionPo> findRegions() throws Exception {
        List<RegionPo> regionPos = regionAdapter.findRegions();
        return regionPos;
    }

    @Override
    public RegionPo getRegionById(Long id) throws Exception {
        return regionAdapter.getRegionById(id);
    }
}
